package com.lovo.model.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserDTO {
    private Integer userId;
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1\\d{10}$",message = "手机号必须为11位数字")
    private String phone;
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^.{6,20}$",message = "密码必须在6-20位之间")
    private String pwd;
    private List invoiceList = new ArrayList();
    private List roleList = new ArrayList();

    public UserDTO(Integer userId, String phone) {
        this.userId = userId;
        this.phone = phone;
    }
}
